﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Parallel3M.parallel3m.framework;
using System.Collections;
using System.Xml;

namespace Parallel3M.parallel3m.payload
{
    public class PayloadNode
    {
        public String name;
        public int status;
        public ParallelPayload payload;
        public ArrayList inputNodes=new ArrayList();
        public ArrayList outputNodes=new ArrayList();

        //parse the payloadNode
        /*
         <payloadnode name="a1">
         *              <payload/>
         *          </payloadnode>

        */
        public void parse(XmlNode node)
        {
            XmlAttributeCollection nodeatts = node.Attributes;
            Hashtable parseParameters = new Hashtable();
            foreach (XmlAttribute att in nodeatts)
            {
                parseParameters.Add(att.Name, att.Value);
            }            
            name = (String)parseParameters["name"];
            foreach (XmlNode childnode in node)
            {
                if (childnode.Name == "payload")
                {
                    payload = new ParallelPayload();
                    payload.parse(childnode);
                    payload.id = name;
                }

            }
        }


    }
}
